﻿@model UA.Data.ViewModels.LoginModel
@{
    ViewBag.Title = "Login";
}


<h2>Login - 登录页面</h2>
<script type="text/javascript">
    $(function () {
        var msg = "@ViewBag.Message";
        if (msg) {
            $.messager.show({ title: "操作提醒", msg: msg });
        }

        $("#loginForm").submit(function () {
            return $(this).form("validate");
        });

        $("#btnSubmit").click(function () {
            $("#loginForm").submit();
        });

        $("#btnReset").click(function () {
            $("#loginForm").form("reset");
        });
    });
</script>
@UA.Framework.Authorization.UAAuthentication.IsAuthenticated
<div class="easyui-window" data-options="width: 400, height: 280, left: 80, top: 100">
    @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { id = "loginForm", @class = "login-form" }))
    {
        @Html.AntiForgeryToken()
        <p>
            @Html.LabelFor(m => m.LoginCode)
            @Html.TextBoxFor(m => m.LoginCode, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[3, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.Password)
            @Html.PasswordFor(m => m.Password, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.Captcha)
            @Html.TextBoxFor(m => m.Captcha, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "validType: 'length[3, 6]'" } })
        </p>
        <p>
            @Html.CheckBoxFor(m => m.RememberMe)
            @Html.LabelFor(m => m.RememberMe)
        </p>
        <hr />
        <p>
            <input id="btnSubmit" type="button" value="登录" />
            <input id="btnReset" type="button" value="重置" />
        </p>
    }
</div>
